
export default {

    dateToStr(obj,attr){
        if(obj[attr]){

            if(obj[attr][0]){
                obj[attr+"From"] = obj[attr][0].format("YYYY-MM-DD")
            }else{
                obj[attr+"From"] = null;
            }

            if(obj[attr][1]){
                obj[attr+"To"] = obj[attr][1].format("YYYY-MM-DD")
            }else{
                obj[attr+"To"] = null;
            }
            
        }else{
            obj[attr+"From"] = null;
            obj[attr+"To"] = null;
        }
        delete obj[attr];
    }
}